#!/usr/bin/env python  
# encoding: utf-8   

""" 
@version: v1.0 
@author: null 
@software: PyCharm 
@file: url.py 
@time: 2017.4.29 9:25 
"""


class URL(object):
    host="http://m.weibo.cn/"

    #post登录
    @staticmethod
    def login():
        return "https://passport.weibo.cn/sso/login"

    #get微博首页
    @staticmethod
    def index():
        return  URL.host

    #get自己关注的微博时间线
    @staticmethod
    def myfriends():
        return URL.host+"feed/friends?version=v4"

    #get自己的微博，page第几页
    @staticmethod
    def myblogs(page=1):
        return URL.host+"index/my?format=cards&page=%s"%page

    #get别人的微博，uid博主id，q页数，其他参数待定
    @staticmethod
    def herblogs(uid,q):
        return URL.host+"container/getIndex?uid=%s&luicode=10000011&lfid=100103type=3&q=%s&type=uid&value=%s&containerid=1076031640571365"%(uid,q,uid)

    #post {"id": mBlogId, "st": st, "attitude": "heart"} 点赞
    @staticmethod
    def likeadd():
        return URL.host+"attitudesDeal/add"

    #post {"id": mBlogId, "st": st} 取消赞
    @staticmethod
    def likedelete():
        return URL.host+"attitudesDeal/delete"

    #get 搜索  搜索关键字
    @staticmethod
    def search(query,code,oid,luicode):
        return URL.host+"api/container/getIndex?type=all&queryVal="+str(query)+"&featurecode="+str(code)+"&oid="+str(oid)+"&luicode="+str(luicode)+"&lfid=106003type%3D1&title="+str(query)+"&containerid=100103type%3D1%26q%3D"+str(query)

    #post 取消关注
    @staticmethod
    def followdelete():
        return URL.host+"api/friendships/destory"

    #post 关注
    @staticmethod
    def followadd():
        return URL.host+"api/friendships/create"

    #搜索页面
    @staticmethod
    def searchPage():
        return URL.host+"searchs"

    #post 搜索请求关键字
    @staticmethod
    def searchKey():
        return URL.host+"searchs/suggest"

    #他人微博页面
    @staticmethod
    def herblogsIndex(uid):
        return URL.host+"/u/"+uid

    #post 发送评论
    @staticmethod
    def sendComment():
        return URL.host+"commentDeal/addCmt"

    #post 转发
    @staticmethod
    def rtBlog():
        return URL.host+"mblogDeal/rtMblog"